
#include <iostream>
#include <string>
#include <sstream>

#include "fingerprint.h"

#include "Hasher.h"

using namespace std;

typedef unsigned long long uInt64;


uInt64 Hasher::hash64FromString(string in){
	fingerprint_init();
	union {
		fingerprint_t _hash;
		uInt64 value;
	} hash64;
	hash64._hash = fingerprint_from_text(in.c_str());
	return hash64.value;
}

string Hasher::stringHash64FromString(std::string in){
	fingerprint_init();
	string _hash;
	union {
		fingerprint_t _hash;
		uInt64 value;
	} hash64;
	hash64._hash = fingerprint_from_text(in.c_str());
	stringstream temp;
	temp << hex << hash64.value;
	temp >> hex >> _hash;
	while(_hash.size() < 16) _hash = "0"+_hash;
	return _hash;
}
